package com.mszlu.rpc.provider.service.impl;

import com.dai.rpc.annotation.MyService;
import com.mszlu.rpc.provider.service.GoodsService;
import com.mszlu.rpc.provider.service.modal.Goods;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

// 把该类放入bean容器中
@Service
// 把GoodsService服务发布，消费方就可以进行调用了
@MyService(version = "1.0")
public class GoodsServiceImpl implements GoodsService {


    @Value("${server.port}")
    private int port;

    public Goods findGoods(Long id) {
        return new Goods(id,"服务方提供服务，端口是:" + port, BigDecimal.valueOf(100));
    }
}
